// 服务端构建配置文件
const nodeExternals = require('webpack-node-externals')
const VueSSRServerPlugin = require('vue-server-renderer/server-plugin')

module.exports = {
    css: {
        extract: false // 不提取css
    },
    outputDir: 'serverDist',
    configureWebpack: ()=> ({
        entry: "./src/server-entry.js",
        devtool: 'source-map',
        target: 'node',
        output: {
            libraryTarget: 'commonjs2',
            
        },
        
        externals: nodeExternals({
            allowlist: [/\.css$/]
        }),
        optimization: {
            splitChunks: false
        },
        plugins: [
            new VueSSRServerPlugin()
        ]
    })
}